Interview-1

Find error from the log file.

if grep -q "ERROR" /home/infrmtca/bin/logfile 

then

      echo "Failure"

else

      echo "Success"

fi

How to send email notification.

echo -e "This is system generated notification mail - \n\n Event Summary :  Job completed  \n Job Completion Time : $(date +'%a %B %d %H:%M:%S %Y')  \n " |mailx  -s "Please enter subject Line $(date)" -S "from=xyz@xyz.com"  xyz@xyz.com

How to open a read-only file in Unix/shell?

Read-only file can be opened by:

vi –R <File Name>

How can the contents of a file inside jar be read without extracting in a shell script?

The contents of the file inside a jar can be read without extracting in a shell script as shown below.

tar –tvf <File Name>.tar

What is history commands ?

It list all command which used recently used.

What are the default permissions of a file when it is created?

666 i.e. rw-rw-rw- is the default permission of a file, when it is created.




No comments:

Post a Comment